Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 6 - Transform Objects / Transform Objects Reference
Functions / Transforming Shapes by Modifying Transform Mappings


GXScaleTransform

You can use the GXScaleTransform function to alter the mapping property of a transform object so that it scales its associated shape by specified horizontal and vertical factors about a specified origin.

void GXScaleTransform(gxTransform target, Fixed hScale, 
                     Fixed vScale, Fixed xOffset, Fixed yOffset);
target
A reference to the transform object whose mapping property you want to alter.
hScale
The horizontal scaling factor.
vScale
The vertical scaling factor.
xOffset
The horizontal coordinate of the origin to scale about.
yOffset
The vertical coordinate of the origin to scale about.
DESCRIPTION
The GXScaleTransform function calculates a new mapping matrix for the transform object referenced by the target parameter. When applied to a shape, the new mapping matrix performs the same mapping transformations on the shape as the original matrix, but the new matrix also scales the shape horizontally by the factor indicated by the hScale parameter and vertically by the factor indicated by the vScale parameter. The new matrix scales the shape about the origin specified by the xOffset and yOffset parameters. (The origin is the point whose coordinates do not change as a result of the scaling operation.)

A value of ff(1) for the hScale or vScale parameter indicates no change of scale in the corresponding direction.

The coordinates of the origin are specified in local space.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
transform_is_nil 
Warnings 
scale_transform_out_of_range 
Notices (debugging version) 
mapping_unaffected 
SEE ALSO
For examples of the use of this function, see page 6-17 and Listing 6-3 on page 6-25.

For information about mapping matrices in general, see the mathematics chapter of Inside Macintosh: QuickDraw GX Environment and Utilities.

To scale a shape by altering its geometry, use the GXScaleShape function, described on page 6-68.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996